class A:
    name = "A"

    def __init__(self):
        self.__i = 1
        self.num = 1
        pass

    def _hello(self):
        print(self.__i)
        return "A _hello"

    def __hello(self):
        return "A __hello"

    def show(self):
        return self.__hello()


class B(A):
    def __init__(self):
        self.__i = 2
        self.num = 5
        pass

    def _hello(self):
        print(self.__i)
        return "B _hello"

    def __hello(self):
        return "B __hello"

    def show(self):
        return self.__hello()


b = B()
a = A()
# print(dir(a))  # ['_A__hello', '_A__i',...]
# print(dir(b))  # ['_A__hello', '_B__hello',...] 也包含 A 的 __hello
print(dir(A))
print(b.name)  # A
print(b.show())  # A __hello

# print(a.show())  # A __hello
# print(b.show())  # A __hello
print(b._hello())  # B _hello
print(a._hello())  # a A _hello
